#coding:utf-8

from encSear import encSearBase
import pycurl
import re
__metaclass__=type #新式类

class md5cc(encSearBase):
  def __init__(self):
    super(md5cc,self).__init__(url='http://www.md5.cc/ShowMD5Info.asp',
                 patt=r'(?<=line\-height\:25px">).*?(?=</span><br>)',
                 isP=False,
                 data='md5_str=FUZZ')      
    self.rq.setopt(pycurl.REFERER,'http://www.md5.cc')
    
  def anlResponse(self):                       #解析返回的东西
    '''Analyze result html file'''
    #print self.ansResponse
    andPat=re.compile(self.webPattern,re.S)
    self.ans=andPat.search(self.ansResponse)
    ans=self.ans.group(0)
    if ans==(u'很抱歉，您输入的密文没有记录！').encode('GBK'):   #这个网站返回的编码是GBK
      return "Not Found!"
    else:
      return ans